home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Cafe 3
/
Visual Cafe 3.ISO
/
Vcafe
/
JFC.bin
/
Element.java
< prev
next >
Wrap
Text File
|
1998-06-30
|
3KB
|
116 lines
/*
* @(#)Element.java 1.11 98/04/09
*
* Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun.
*
* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
* SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*
*/
package com.sun.java.swing.text;
/**
* Interface to describe a structural piece of a document. It
* is intended to capture the spirit of an SGML element.
*
* @author Timothy Prinzing
* @version 1.11 04/09/98
*/
public interface Element {
/**
* Fetches the document associated with this element.
*
* @return the document
*/
public Document getDocument();
/**
* Fetches the parent element. If the element is a root level
* element returns null.
*
* @return the parent element
*/
public Element getParentElement();
/**
* Fetches the name of the element. If the element is used to
* represent some type of structure, this would be the type
* name.
*
* @return the element name
*/
public String getName();
/**
* Fetches the collection of attributes this element contains.
*
* @return the attributes for the element
*/
public AttributeSet getAttributes();
/**
* Fetches the offset from the beginning of the document
* that this element begins at. If this element has
* children, this will be the offset of the first child.
*
* @return the starting offset >= 0
*/
public int getStartOffset();
/**
* Fetches the offset from the beginning of the document
* that this element ends at. If this element has
* children, this will be the end offset of the last child.
*
* @return the ending offset >= 0
*/
public int getEndOffset();
/**
* Gets the child element index closest to the given offset.
* The offset is specified relative to the begining of the
* document.
*
* @param offset the specified offset >= 0
* @return the element index >= 0
*/
public int getElementIndex(int offset);
/**
* Gets the number of child elements contained by this element.
* If this element is a leaf, a count of zero is returned.
*
* @return the number of child elements >= 0
*/
public int getElementCount();
/**
* Fetches the child element at the given index.
*
* @param index the specified index >= 0
* @return the child element
*/
public Element getElement(int index);
/**
* Is this element a leaf element?
*
* @return true if a leaf element else false
*/
public boolean isLeaf();
}